﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Windows.Storage.Streams;

namespace XcoAppSpaces.Transport.Sockets
{
	static class DataReaderExtensions
	{
		public static uint Read(this DataReader reader, byte[] buffer)
		{
			var t = reader.LoadAsync((uint)buffer.Length).AsTask();
			t.Wait();
			reader.ReadBytes(buffer);
			return t.Result;
		}
	}
}
